Ext.define('Zm.view.line.Search',{
    alias:'widget.linesearch',
    extend:'Ext.grid.Panel',
    requires:['Ext.toolbar.Toolbar'],
    store:'Line',
    initComponent:function(){
        var me = this,
            lang = Zm.i18n.Lang;
            
        Ext.apply(me,{
            title: lang.tLineFind,
            iconCls:'linesearch',
            layout:'fit',
            columns:[
                {text:'ID',dataIndex:'lineid'},
                {text:lang.tLineName,dataIndex:'linename',renderer:me.rendTip},
                {text:lang.tLineType,dataIndex:'typename',renderer:me.rendTip},
                {text:lang.tDev1,dataIndex:'dev1name',renderer:me.rendTip},
                {text:lang.tPortBh,dataIndex:'dev1bh',renderer:me.rendTip},
                {text:lang.tDev2,dataIndex:'dev2name',renderer:me.rendTip},
                {text:lang.tPortBh,dataIndex:'dev2bh',renderer:me.rendTip},
                {text:lang.tDesc,dataIndex:'desc',flex:1,renderer:me.rendTip}
            ],
            dockedItems:[{
                xtype:'toolbar',
                items:[{
                    text:lang.tAddLine,
                    iconCls:'lineadd',
                    action:'add'  
                },{
                    text:lang.tDel,
                    iconCls:'linedel',
                    action:'del'
                },'-',lang.tKeyword,{
                    xtype:'textfield',
                    itemId:'keyword'
                },{
                    text:lang.tSearch,
                    iconCls:'btn-search',
                    action:'search'
                }]
            },{
                xtype: 'pagingtoolbar',
                store: me.store,
                dock: 'bottom',
                displayInfo: true                    
            }]
        });
        me.callParent(arguments);
    },
    rendTip:function(value,metaData){
        metaData.tdAttr = 'data-qtip="' + Ext.String.htmlEncode(value) + '"';
        return value;
    }
});